import type { Config } from "tailwindcss";
import { getIconCollections, iconsPlugin } from "@egoist/tailwindcss-icons";
import cssMacro from "weapp-tailwindcss/css-macro";
import { isMp } from "./platform";

export default <Config>{
    content: ["./index.html", "./src/**/*.{html,js,ts,jsx,tsx,vue}"],
    theme: {
        extend: {
            colors: {
                primary: "#2A2A2A",
                secondary: "#1A1A1A",
                accent: "#E50914"
            }
        }
    },
    // https://weapp-tw.icebreaker.top/docs/quick-start/uni-app-css-macro
    plugins: [
        cssMacro({
            variantsMap: {
                wx: "MP-WEIXIN",
                "-wx": {
                    value: "MP-WEIXIN",
                    negative: true
                }
                // 定义多个条件判断
                // mv: {
                //   value: 'H5 || MP-WEIXIN'
                // },
                // '-mv': {
                //   value: 'H5 || MP-WEIXIN',
                //   negative: true
                // }
            }
        }),
        iconsPlugin({
            // 在这里可以选择你要使用的 icon, 更多详见:
            // https://icon-sets.iconify.design/
            collections: getIconCollections(["svg-spinners", "mdi"])
        })
    ],
    corePlugins: {
        // 小程序去使用 h5 的 preflight 和响应式 container 没有意义
        preflight: !isMp,
        container: !isMp
    }
};
